home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
Bank smakow
/
BankSmakow.air
/
BankSmakow.swf
/
scripts
/
com
/
makingwaves
/
view
/
PrintView.as
< prev
next >
Wrap
Text File
|
2009-12-16
|
9KB
|
247 lines
package com.makingwaves.view
{
import com.makingwaves.vo.Recipe;
import mx.containers.HBox;
import mx.containers.VBox;
import mx.controls.Image;
import mx.controls.Label;
import mx.controls.Spacer;
import mx.controls.Text;
import mx.core.UIComponentDescriptor;
import mx.core.mx_internal;
import mx.events.PropertyChangeEvent;
import mx.printing.FlexPrintJob;
import mx.styles.CSSStyleDeclaration;
public class PrintView extends VBox
{
private var _351679175recipeName:Text;
private var _2103719742ingredients:Text;
private var _1315428713preparation:Text;
private var _recipe:Recipe;
private var _embed_mxml____assets_details_origin1_png_1061770266:Class;
private var _documentDescriptor_:UIComponentDescriptor;
public function PrintView()
{
_documentDescriptor_ = new UIComponentDescriptor({
"type":VBox,
"propertiesFactory":function():Object
{
return {"childDescriptors":[new UIComponentDescriptor({
"type":VBox,
"stylesFactory":function():void
{
this.verticalGap = 0;
this.paddingTop = 40;
this.paddingBottom = 40;
this.paddingLeft = 40;
this.paddingRight = 40;
},
"propertiesFactory":function():Object
{
return {
"percentHeight":100,
"width":800,
"childDescriptors":[new UIComponentDescriptor({
"type":Text,
"id":"recipeName",
"propertiesFactory":function():Object
{
return {
"styleName":"RecipeDetailsTitlePrint",
"width":720,
"x":50,
"y":90,
"percentHeight":100
};
}
}),new UIComponentDescriptor({
"type":HBox,
"propertiesFactory":function():Object
{
return {
"percentHeight":100,
"width":720,
"childDescriptors":[new UIComponentDescriptor({
"type":Text,
"id":"ingredients",
"propertiesFactory":function():Object
{
return {
"styleName":"RecipeDetailsIngredientsPrint",
"width":550,
"percentHeight":100,
"selectable":false
};
}
}),new UIComponentDescriptor({
"type":Spacer,
"propertiesFactory":function():Object
{
return {"percentWidth":100};
}
}),new UIComponentDescriptor({
"type":Image,
"stylesFactory":function():void
{
this.right = "5";
},
"propertiesFactory":function():Object
{
return {
"source":_embed_mxml____assets_details_origin1_png_1061770266,
"width":120,
"height":120
};
}
})]
};
}
}),new UIComponentDescriptor({
"type":Spacer,
"propertiesFactory":function():Object
{
return {"height":20};
}
}),new UIComponentDescriptor({
"type":Label,
"propertiesFactory":function():Object
{
return {
"text":"Spos├│b przygotowania",
"styleName":"RecipeDetailsPreparationTitlePrint"
};
}
}),new UIComponentDescriptor({
"type":Text,
"id":"preparation",
"propertiesFactory":function():Object
{
return {
"styleName":"RecipeDetailsPreparationPrint",
"width":720,
"percentHeight":100
};
}
})]
};
}
})]};
}
});
_embed_mxml____assets_details_origin1_png_1061770266 = PrintView__embed_mxml____assets_details_origin1_png_1061770266;
super();
mx_internal::_document = this;
if(!this.styleDeclaration)
{
this.styleDeclaration = new CSSStyleDeclaration();
}
this.styleDeclaration.defaultFactory = function():void
{
this.backgroundColor = 16777215;
this.borderColor = 16777215;
this.borderThickness = 2;
};
this.horizontalScrollPolicy = "off";
this.verticalScrollPolicy = "off";
}
[Bindable(event="propertyChange")]
public function get ingredients() : Text
{
return this._2103719742ingredients;
}
public function set ingredients(param1:Text) : void
{
var _loc2_:Object = this._2103719742ingredients;
if(_loc2_ !== param1)
{
this._2103719742ingredients = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"ingredients",_loc2_,param1));
}
}
public function get recipe() : Recipe
{
return _recipe;
}
private function set _934914674recipe(param1:Recipe) : void
{
_recipe = param1;
}
override public function initialize() : void
{
mx_internal::setDocumentDescriptor(_documentDescriptor_);
super.initialize();
}
[Bindable(event="propertyChange")]
public function set recipe(param1:Recipe) : void
{
var _loc2_:Object = this.recipe;
if(_loc2_ !== param1)
{
this._934914674recipe = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"recipe",_loc2_,param1));
}
}
[Bindable(event="propertyChange")]
public function get preparation() : Text
{
return this._1315428713preparation;
}
public function doPrint() : void
{
ingredients.text = _recipe.ingredientsText;
recipeName.text = _recipe.name;
preparation.text = _recipe.preparation;
var _loc1_:FlexPrintJob = new FlexPrintJob();
if(_loc1_.start() != true)
{
return;
}
_loc1_.addObject(this);
_loc1_.send();
}
public function set preparation(param1:Text) : void
{
var _loc2_:Object = this._1315428713preparation;
if(_loc2_ !== param1)
{
this._1315428713preparation = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"preparation",_loc2_,param1));
}
}
public function set recipeName(param1:Text) : void
{
var _loc2_:Object = this._351679175recipeName;
if(_loc2_ !== param1)
{
this._351679175recipeName = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"recipeName",_loc2_,param1));
}
}
[Bindable(event="propertyChange")]
public function get recipeName() : Text
{
return this._351679175recipeName;
}
}
}